/*
 * EDAS2 - TetraTech, Inc.
 *
 * Distributable under GPL license.
 * See terms of license at gnu.org.
 */
package com.tetratech.edas2.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * AnalyticalMethod generated by hbm2java
 */
@Entity
@Table(name = "ED_ANALYTICAL_METHOD")
public class AnalyticalMethod extends AttributableUpdateRetireEntity
		implements
			java.io.Serializable {

	private Long uid;
	private Organization organization;
	private int amctxUid;
	private String secondaryId;
	private String name;
	private String description;
	private String type;
	private Set<Result> results = new HashSet<Result>(0);

	public AnalyticalMethod() {
	}

	public AnalyticalMethod(Long uid, int amctxUid, String secondaryId,
			String name) {
		this.uid = uid;
		this.amctxUid = amctxUid;
		this.secondaryId = secondaryId;
		this.name = name;
	}

	@Id
	@Column(name = "ANLMTH_UID", unique = true, nullable = false, precision = 6, scale = 0)
	@NotNull
	public Long getUid() {
		return this.uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORG_UID")
	public Organization getOrganization() {
		return this.organization;
	}

	public void setOrganization(Organization organization) {
		this.organization = organization;
	}

	@Column(name = "AMCTX_UID", nullable = false, precision = 6, scale = 0)
	@NotNull
	public int getAmctxUid() {
		return this.amctxUid;
	}

	public void setAmctxUid(int amctxUid) {
		this.amctxUid = amctxUid;
	}

	@Column(name = "ANLMTH_ID", nullable = false, length = 20)
	@NotNull
	@Length(max = 20)
	public String getSecondaryId() {
		return this.secondaryId;
	}

	public void setSecondaryId(String secondaryId) {
		this.secondaryId = secondaryId;
	}

	@Column(name = "ANLMTH_NAME", nullable = false, length = 120)
	@NotNull
	@Length(max = 120)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "ANLMTH_DESC", length = 500)
	@Length(max = 500)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "ANLMTH_QUAL_TYPE", length = 25)
	@Length(max = 25)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "analyticalMethod")
	public Set<Result> getResults() {
		return this.results;
	}

	public void setResults(Set<Result> results) {
		this.results = results;
	}

}
